<?php
require_once('tpl/head.php');
include_once('./system/dbConn.php');
connect();
$sql="select * from videos";
if (isset($_GET["key"])) {
    $key=trim($_GET["key"]);
    $sql="select*  from videos where videoname like '%{$key}%'";
}
$result=mysql_query($sql);
    $num=mysql_num_rows($result);
    if ($num==0) {
        echo "没有匹配的对象，请重新输入";
        exit;
    }

?>


<div class="container">

    <div class="row row-offcanvas row-offcanvas-right">

        <div class="col-xs-12 col-sm-9">


            <div class="row">


                <div class="col-xs-12 col-lg-12 mlist">
                    <h2><?php echo $row["typename"]; ?></h2>
                    <ul class="list-inline row text-center">
                    <?php while ($row=mysql_fetch_assoc($result)) {?>

                        <li class="col-xs-6 col-lg-3">
                            <img src="./posters/<?php echo $row["pic"]; ?>" class="responsive img-thumbnail"/>

                            <p><a href="show.php"><?php echo $row["videoname"]; ?></a>
                            </p>
                        </li>
                        <?php  } ?>
                    </ul>
                    <nav class="text-center">
                        <ul class="pagination">
                            <li>
                                <a href="#" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                            <li><a href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li>
                                <a href="#" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </ul>
                    </nav>


                </div>
                <!--/.col-xs-6.col-lg-4-->

            </div>
            <!--/row-->
        </div>
        <!--/.col-xs-12.col-sm-9-->

        
    </div>
    <!--/row-->

    

</div>
<!--/.container-->
<?php
require_once('tpl/foot.php');
?>